package com.TwinBlade.PicturePassword;

import android.app.Activity;
import android.content.SharedPreferences;
import android.content.SharedPreferences.Editor;
import android.os.Bundle;
import android.preference.PreferenceManager;
import android.widget.ArrayAdapter;
import android.widget.Button;
import android.widget.Spinner;
import java.util.ArrayList;
import java.util.Arrays;
import java.util.Iterator;
import java.util.List;

public class GesturePreferencesPlus extends Activity
{
  private Spinner a;
  private Spinner b;
  private Spinner c;
  private Spinner d;
  private Spinner e;
  private List f;
  private List g = Arrays.asList(new String[] { "FirstGestureType", "SecondGestureType", "ThirdGestureType", "FourthGestureType", "FifthGestureType" });
  private List h;
  private SharedPreferences i;

  private String a(String paramString)
  {
    Iterator localIterator = this.h.iterator();
    v localv;
    do
    {
      if (!localIterator.hasNext())
        return "none";
      localv = (v)localIterator.next();
    }
    while (!localv.a.equals(paramString));
    return localv.b;
  }

  private void a()
  {
    ArrayList localArrayList = new ArrayList();
    Iterator localIterator = this.h.iterator();
    while (true)
    {
      if (!localIterator.hasNext())
      {
        ArrayAdapter localArrayAdapter = new ArrayAdapter(this, 17367048, localArrayList);
        localArrayAdapter.setDropDownViewResource(17367049);
        this.a.setAdapter(localArrayAdapter);
        this.b.setAdapter(localArrayAdapter);
        this.c.setAdapter(localArrayAdapter);
        this.d.setAdapter(localArrayAdapter);
        this.e.setAdapter(localArrayAdapter);
        return;
      }
      localArrayList.add(((v)localIterator.next()).a);
    }
  }

  private void b()
  {
    int j = 4;
    int k = 3;
    int m = 2;
    int i3;
    int i4;
    label48: label62: int i2;
    label97: label111: label124: int i1;
    label159: label173: label186: int n;
    if (a(String.valueOf(this.a.getSelectedItem())).equals("none"))
    {
      i3 = 1;
      if (i3 >= this.f.size())
      {
        i4 = 1;
        if (i4 < this.g.size())
          break label291;
        if (this.b.isEnabled())
        {
          if (!a(String.valueOf(this.b.getSelectedItem())).equals("none"))
            break label427;
          i2 = m;
          if (i2 < this.f.size())
            break label344;
          if (m < this.g.size())
            break label386;
        }
        if (this.c.isEnabled())
        {
          if (!a(String.valueOf(this.c.getSelectedItem())).equals("none"))
            break label521;
          i1 = k;
          if (i1 < this.f.size())
            break label438;
          if (k < this.g.size())
            break label480;
        }
        if (this.d.isEnabled())
        {
          if (!a(String.valueOf(this.d.getSelectedItem())).equals("none"))
            break label615;
          n = j;
          label221: if (n < this.f.size())
            break label532;
        }
      }
    }
    while (true)
    {
      if (j >= this.g.size())
      {
        return;
        ((Spinner)this.f.get(i3)).setSelection(0);
        ((Spinner)this.f.get(i3)).setEnabled(false);
        i3++;
        break;
        label291: this.i.edit().putString((String)this.g.get(i4), "none").commit();
        i4++;
        break label48;
        this.b.setEnabled(true);
        break label62;
        label344: ((Spinner)this.f.get(i2)).setSelection(0);
        ((Spinner)this.f.get(i2)).setEnabled(false);
        i2++;
        break label97;
        label386: this.i.edit().putString((String)this.g.get(m), "none").commit();
        m++;
        break label111;
        label427: this.c.setEnabled(true);
        break label124;
        label438: ((Spinner)this.f.get(i1)).setSelection(0);
        ((Spinner)this.f.get(i1)).setEnabled(false);
        i1++;
        break label159;
        label480: this.i.edit().putString((String)this.g.get(k), "none").commit();
        k++;
        break label173;
        label521: this.d.setEnabled(true);
        break label186;
        label532: ((Spinner)this.f.get(n)).setSelection(0);
        ((Spinner)this.f.get(n)).setEnabled(false);
        n++;
        break label221;
      }
      this.i.edit().putString((String)this.g.get(j), "none").commit();
      j++;
    }
    label615: this.e.setEnabled(true);
  }

  public void finish()
  {
    if ((a(String.valueOf(this.a.getSelectedItem())).equals("none")) && (a(String.valueOf(this.b.getSelectedItem())).equals("none")) && (a(String.valueOf(this.c.getSelectedItem())).equals("none")) && (a(String.valueOf(this.d.getSelectedItem())).equals("none")) && (a(String.valueOf(this.e.getSelectedItem())).equals("none")))
      setResult(0);
    while (true)
    {
      super.finish();
      return;
      setResult(-1);
    }
  }

  public void onCreate(Bundle paramBundle)
  {
    super.onCreate(paramBundle);
    setContentView(2130903043);
    v[] arrayOfv = new v[4];
    arrayOfv[0] = new v(getString(2131296464), "none");
    arrayOfv[1] = new v(getString(2131296465), "point");
    arrayOfv[2] = new v(getString(2131296466), "line");
    arrayOfv[3] = new v(getString(2131296467), "circle");
    this.h = Arrays.asList(arrayOfv);
    this.i = PreferenceManager.getDefaultSharedPreferences(this);
    this.i.edit().putString("FirstGestureData", "0").commit();
    this.i.edit().putString("SecondGestureData", "0").commit();
    this.i.edit().putString("ThirdGestureData", "0").commit();
    this.i.edit().putString("FourthGestureData", "0").commit();
    this.i.edit().putString("FifthGestureData", "0").commit();
    this.a = ((Spinner)findViewById(2131230728));
    this.b = ((Spinner)findViewById(2131230730));
    this.c = ((Spinner)findViewById(2131230732));
    this.d = ((Spinner)findViewById(2131230735));
    this.e = ((Spinner)findViewById(2131230737));
    a();
    this.a.setOnItemSelectedListener(new ac(this, null));
    this.b.setOnItemSelectedListener(new ae(this, null));
    this.c.setOnItemSelectedListener(new af(this, null));
    this.d.setOnItemSelectedListener(new ad(this, null));
    this.e.setOnItemSelectedListener(new ab(this, null));
    Spinner[] arrayOfSpinner = new Spinner[5];
    arrayOfSpinner[0] = this.a;
    arrayOfSpinner[1] = this.b;
    arrayOfSpinner[2] = this.c;
    arrayOfSpinner[3] = this.d;
    arrayOfSpinner[4] = this.e;
    this.f = Arrays.asList(arrayOfSpinner);
    b();
    ((Button)findViewById(2131230733)).setOnClickListener(new aa(this));
  }
}

/* Location:           D:\Studium\Bachelorarbeit\BA Marcus Wobig\BA\BA\Decompiler\PicturePassword APK\Programm\PicturePassword_dex2jar.jar
 * Qualified Name:     com.TwinBlade.PicturePassword.GesturePreferencesPlus
 * JD-Core Version:    0.6.2
 */